import './App.css';

//rcc 生成类组件
//rsf 生成函数式组件

import React, { Component ,lazy,Suspense} from 'react';
import {Route,Redirect,Switch} from 'react-router-dom';


var Baocuo=lazy(()=>import('./components/Baocuo'))
var Login=lazy(()=>import('./views/Login'))
var Register=lazy(()=>import('./views/Register'))
var Index=lazy(()=>import('./views/Index'))
var Jiaoyutoutiao=lazy(()=>import('./views/Jiaoyutoutiao'))
var Feixianghd=lazy(()=>import('./views/Feixianghd'))
var Zixunjiaoshi=lazy(()=>import('./views/Zixunjiaoshi'))
var Jiaoshijieshao=lazy(()=>import('./views/Jiaoshijieshao'))
var Houdongxx=lazy(()=>import('./views/Houdongxx'))
var Kechengxx=lazy(()=>import('./views/Kechengxx'))
var Sousujg=lazy(()=>import('./views/Sousujg'))

class App extends Component {
  render() {
    return (
      <div className='app'>
      <Suspense fallback={<div  className='loading'><img src="https://hbimg.b0.upaiyun.com/42c725b3935a1ce3e32897b9995c1b6a2e921d335690-Ck6vZO_fw658" alt="" /></div>}>
          <Switch>
            <Route  path="/index" component={Index} />
            <Route exact path="/login" component={Login} />
            <Route exact path="/register" component={Register} />
            <Route exact path="/jiaoyutoutiao" component={Jiaoyutoutiao} />
            <Route exact path="/feixianghd" component={Feixianghd} />
            <Route exact path="/zixunjiaoshi" component={Zixunjiaoshi} />
            <Route exact path="/jiaoshijieshao" component={Jiaoshijieshao} />
            <Route exact path="/houdongxx" component={Houdongxx} />
            <Route exact path="/kechengxx" component={Kechengxx} />
            <Route exact path="/sousujg" component={Sousujg} />
            <Redirect exact from='/' to="/register" />
            <Route exact path="*" component={Baocuo} />
          </Switch>
        </Suspense>
      </div>
    );
  }    
}

export default App;